
// **************
// Theme
// **************

#gn-components-theme(@theme-vars) {
    .gn-visual-style-editor,
    .gn-visual-style-editor-templates,
    .ms-style-rules-editor-head {
        .background-color-var(@theme-vars[main-bg]);
    }
    .gn-visual-style-editor-layer-info,
    .gn-visual-style-editor-styles {
        .border-bottom-color-var(@theme-vars[main-border-color]);
    }
    .gn-visual-style-editor-template {
        &.selected {
            .outline-color-var(@theme-vars[focus-color]);
        }
    }
}

// **************
// Layout
// **************

.gn-visual-style-editor {
    position: absolute;
    display: flex;
    flex-direction: column;
    z-index: 1050;
    height: 100%;
    width: 500px;
    top: 0;
    left: 0;
    .shadow-soft();
    .Select-menu-outer {
        z-index: 100;
    }
}

.gn-visual-style-editor-layer-info {
    display: flex;
    padding: 0;
    align-items: center;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    .gn-visual-style-editor-layer-title {
        flex: 1;
        padding-left: 12px;
    }
}

.gn-visual-style-editor-styles,
.gn-visual-style-editor-alert {
    display: flex;
    flex-direction: 1;
    padding: 4px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    .gn-visual-style-editor-styles-select {
        flex: 1;
    }
}

.gn-visual-style-editor-alert {
    align-items: center;
}

.gn-visual-style-editor-alert {
    justify-content: space-between;

    button.btn {
        background-color: transparent;
        align-self: flex-start;
    }

    .gn-visual-style-editor-alert-message {
        button.btn {
            padding: 0;
            margin-top: 0.5rem;
            display: block;

            p {
                text-decoration: underline;
            }
        }
    }

}

.gn-visual-style-editor-body {
    position: relative;
    flex: 1;
    height: 100%;
    width: 100%;
    > div {
        position: absolute;
        height: 100%;
        width: 100%; 
    }
}

.gn-visual-style-editor-templates {
    width: 326px;
    max-height: 276px;
    display: flex;
    flex-direction: column;
    ul {
        list-style-type: none;
        padding: 0;
        padding-left: 4px;
        padding-top: 4px;
        overflow: auto;
        display: flex;
        flex-wrap: wrap;
        flex: 1;
    }
    .gn-visual-style-editor-templates-footer {
        padding: 4px;
        display: flex;
        flex-direction: row-reverse;
    }
    .shadow-soft();
    .gn-visual-style-editor-template {
        width: 72px;
        margin-right: 4px;
        margin-bottom: 4px;
        border: 1px solid #ddd;
        cursor: pointer;
        overflow: hidden;
        padding: 2px;
        &:hover {
            .shadow-soft();
        }
        .gn-visual-style-editor-template-title {
            font-size: @font-size-base * 0.6;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            text-align: center;
        }
        &.selected {
            outline-width: 2px;
            outline-style: solid;
        }
    }
}

.ms-style-rules-editor-head {
    position: sticky;
    top: 0;
    z-index: 10;
}

.ms-style-editor-toolbar-left > * + * {
    margin-left: 4px;
}